package com.eric.ipc.binder;

import android.content.Context;
import android.os.Binder;
import android.os.Parcel;
import android.os.RemoteException;

public class MyBinder extends Binder {
	private Context mContext;
	public MyBinder(Context context){
		mContext = context;
	}
	@Override
	protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
			throws RemoteException {
		reply.writeString(data.readString()+" mp3");
		switch(code){
			case 1:
				MyMediaPlayer.getIntance(mContext).play();
				break;
			case 2:
				MyMediaPlayer.getIntance(mContext).stop();
				break;
			default:
				break;
		}
		return true;
	}
}
